<section class="content-header">
	<h1> Management <small>Locations</small></h1>
	<ol class="breadcrumb">
		<li>
			<a href="<?php echo base_url();?>"><i class="fa fa-dashboard"></i> Home</a>
		</li>
		<li>
			<a href="#">Management Locations</a>
		</li>
		<li class="active">
			List all locations
		</li>
		
	</ol>
</section>

<!--<div class="row content">
		<div class="col-xs-12">
			
<div class="alert alert-success alert-dismissable">
		        	<i class="fa fa-check"></i>
		             	<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
		                <b>Alert!</b> Success alert preview. This alert is dismissable.
		        </div>
		        
		     </div>
		  </div>-->
<!-- Main content -->
<section class="content">
	<div class="row">
		<div class="col-xs-12">
			<div class="box">
				<div class="box-header">
					<h3 class="box-title">List all locations </h3>
						<button type="button" class="btn btn-primary pull-right" style="margin-right: 10px; margin-top: 5px;" data-toggle="modal" data-target="#insert-location-modal"><span class="glyphicon glyphicon-plus"></span> Add New</button>
				</div><!-- /.box-header -->
				<div class="box-body table-responsive">
					<table id="example2" class="table table-bordered table-hover">
						<thead>
							<tr>
								<th>Name</th>
								<th>Active</th>
								<th>Created Date</th>
								
								<th>Action</th>
							</tr>
						</thead>
						<tbody>
							<?php
								
								foreach($locations as $location){
									$id=$location->job_location_id;
									$name=$location->name;
									$created=$location->created_date;
									$active=($location->status == '1' )? 'YES' : 'NO';
									
							?>
									<tr>
										
										<td><?php echo $name;?></td>
										<td><?php echo $active;?></td>
										<td><?php echo $created;?></td>
										
										<td align="center">
											
											<a data-toggle="modal" data-target="#update-location-modal" class="btn btn-sm btn-primary edit_location" id="<?php echo $id;?>" title="Update"><span class="glyphicon glyphicon-edit"></span> Edit</a>
											<a href="<?php echo base_url();?>control-settings/delete-location/<?php echo $id;?>" class="btn btn-sm btn-danger" onclick="return confirm('Are you sure want to delete ?');" title="Delete"><span class="glyphicon glyphicon-trash"></span> Delete</a>
										</td>
									</tr>
							<?php
								
								}
							?>
							
						</tbody>
						<tfoot>
							<tr>
								
								<th>Name</th>
								<th>Active</th>
								<th>Created Date</th>
								<th>Action</th>
							</tr>
						</tfoot>
					</table>
				</div><!-- /.box-body -->
			</div><!-- /.box -->

			
		</div>
	</div>

</section><!-- /.content -->
<?php
	$this->load->view(B_TEMPLATE."modals/insert_location");
	$this->load->view(B_TEMPLATE."modals/update_location");
	//include '../modals/insert_category.php';
?>

